﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace HA.ModFlow.Application
{
    /// <summary>
    /// MiniGridView.xaml 的交互逻辑
    /// </summary>
    public partial class MiniGridView : UserControl
    {
        public MiniGridView()
        {
            InitializeComponent();
            this.miniGrid1.SetPathDatas();
        }


        //MiniGridViewModel _viewModel;

        //public MiniGridViewModel ViewModel
        //{
        //    get { return _viewModel; }
        //    set {

        //        _viewModel = value;

        //        this.DataContext = this._viewModel;
            
        //    }
        //}

        private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            string txt = txtNum.Text;

            int num = 1;

            bool b = int.TryParse(txt,out num);

            if (b)
            {

                MiniGridViewModel viewModel = this.DataContext as MiniGridViewModel;

                if (viewModel!=null)
                {

                    viewModel.CurrentNumber = num;
                    
                }
             


                
            }


        }
    }
}
